<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 调试代码 开发的时候常写，上线前删除
        // 瞬间执行的代码
        // event loop 的一个单元
        Promise.resolve().then(() => {
            console.log('promise1');
            setTimeout(() => {
                console.log('settimeout2');
            },0)
        })
        setTimeout(() => {
            console.log('settimeout1');
            Promise.resolve().then(() => {
                console.log('promise2');
            },)
        },0)
        console.log('start');
        Promise.resolve().then(() => {
            console.log('resolve');
        })
        const p = new Promise((resolve,reject) => {
            console.log('p promise instance');
            setTimeout(() => {
                console.log("-----------");
            },0)
        })
        console.log('end');
    </script>
</body>
</html>